package com.bea.ftd.mapping.fallback;

import com.bea.ftd.common.model.EncryptRequest;
import com.bea.ftd.common.model.EncryptResponse;
import com.bea.ftd.mapping.feign.EncryptFeign;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.kafka.core.KafkaTemplate;

public class EncryptFallback implements EncryptFeign {
    @Autowired
    private KafkaTemplate kafkaTemplate;

    @Override
    public EncryptResponse gatewayForward(EncryptRequest request) {
        kafkaTemplate.send("encrypt", request);
        EncryptResponse response = null;
        Object object = "调用加解密服务失败";
        response.setData(object);
        return response;
    }
}
